package www.sofn.com.order.domain.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.List;

@Data
@Schema(description = "创建购物订单")
@Accessors(chain = true)
public class CreateShoppingCartGoodsOrderVo {
    @Schema(description = "订单信息")
    @NotNull(message = "购物车Id不能为空")
    private List<OrderInfo> orderInfos;
    @Schema(description = "收货地址Id")
    @NotBlank(message = "收货地址不能为空")
    private String addressId;
    @Schema(description = "属性信息")
    @Data
    @Accessors(chain = true)
    public static  class AttrInfo{
        @Schema(description = "id")
        private String id;
        @Schema(description = "数量")
        private Integer num;
    }
    @Schema(description = "orderInfo")
    @Data
    @Accessors(chain = true)
    public static class OrderInfo{
        @Schema(description = "购物车id")
        @NotBlank(message = "购物车Id不能为空")
        private String shoppingCartId;
        @Schema(description = "商品id")
        @NotBlank(message = "商品Id不能为空")
        private String goodsId;
        @Schema(description = "商品属性")
        @NotNull(message = "商品属性")
        private List<AttrInfo> attrInfos;
    }
}
